import request from '@/utils/request';

/** 查询bom生产单列表 */
export const getBOMProductOrderApi = (data: any) => {
    return request({
        url: '/system/bomProductionOrder/list',
        method: 'post',
        data: data
    });
};

/** 获取bom生产单详细信息 */
export const getProductOrderDetailApi = (id: any) => {
    return request({
        url: `/system/bomProductionOrder/${id}`,
        method: 'get'
    })
};

/** 申请详情打印次数 */
export const printOrderDetailApi = (data: any) => {
    return request({
        url: `/system/bomProductionOrder/addCount`,
        method: 'put',
        params: data
    })
};

/** 强制绿灯 */
export const forcePassOrderApi = (data: any) => {
    return request({
        url: `/system/bomProductionOrder/updateOverFlag`,
        method: 'put',
        params: data
    })
};

/** 撤销订单 */
export const withdrawOrderApi = (data: any) => {
    return request({
        url: `/system/bomProductionOrder/revokeOrder`,
        method: 'put',
        params: data
    })
};

/** 获取生产单配料申请细节 */
export const getPrintIngredientlDetailApi = (id: any) => {
    return request({
        url: `/system/bomProductionOrder/bomProductionOrderApplyDetail`,
        method: 'get',
        params: {id: id}
    })
};

/** 申请配料打印 */
export const printApplyIngredientlApi = (data: any) => {
    return request({
        url: `/system/bomProductionOrder/printProduceApply`,
        method: 'put',
        data: data
    })
};

/** 获取关联辅材采购情况 */
export const getAuxiliaryDetailApi = (bomId: any) => {
    return request({
        url: '/system/bomProductionOrder/getRecentAuxiliaryList',
        method: 'get',
        params:{bomId: bomId}
    })
};

/** 获取关联半成品下单情况 */
export const getSemiProductDetailApi = (bomId: any) => {
    return request({
        url: '/system/bomProductionOrder/getRecentSemiList',
        method: 'get',
        params:{bomId: bomId}
    })
};